<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="NumberFormatter,mx.formatters.NumberFormatter,decimalSeparatorFrom,decimalSeparatorTo,precision,rounding,thousandsSeparatorFrom,thousandsSeparatorTo,useNegativeSign,useThousandsSeparator,format" name="keywords">
<title>mx.formatters.NumberFormatter</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'NumberFormatter - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/formatters/NumberFormatter.html&amp;mx/formatters/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;NumberFormatter</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class NumberFormatter"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.formatters</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class NumberFormatter</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">NumberFormatter <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="Formatter.html">Formatter</a></td>
</tr>
</table>
<p></p>
  The NumberFormatter class formats a valid number
  by adjusting the decimal rounding and precision,
  the thousands separator, and the negative sign.
   <p>If you use both the <code>rounding</code> and <code>precision</code>
  properties, rounding is applied first, and then you set the decimal length
  by using the specified <code>precision</code> value.
  This lets you round a number and still have a trailing decimal;
  for example, 303.99 = 304.00.</p>
   <p>If an error occurs, an empty String is returned and a String
  describing  the error is saved to the <code>error</code> property.
  The <code>error</code>  property can have one of the following values:</p>
   <ul>
    <li><code>"Invalid value"</code> means an invalid numeric value is passed to 
    the <code>format()</code> method. The value should be a valid number in the 
    form of a Number or a String.</li>
    <li><code>"Invalid format"</code> means one of the parameters
    contain an unusable setting.</li>
  </ul>
  
  <p></p>
<a name="mxmlSyntaxSummary"></a><span class="classHeaderTableLabel">MXML Syntax</span><span style="display:none" id="showMxmlLink"><a onclick="toggleMXMLOnly();" href="#mxmlSyntaxSummary"><img class="collapsedImage" alt="collapsed" title="collapsed" src="../../images/collapsed.gif"> Show MXML Syntax</a>
<br>
</span><span id="hideMxmlLink"><a onclick="toggleMXMLOnly();" href="#mxmlSyntaxSummary"><img class="expandedImage" alt="expanded" title="expanded" src="../../images/expanded.gif"> Hide MXML Syntax</a></span>
<div class="mxmlSyntax" id="mxmlSyntax">  
  <p>The <code>&lt;mx:NumberFormatter&gt;</code> tag
  inherits all of the tag attributes of its superclass,
  and adds the following tag attributes:</p>
  
  <pre>
  &lt;mx:NumberFormatter
    decimalSeparatorFrom="."
    decimalSeparatorTo="."
    precision="-1"
    rounding="none|up|down|nearest"
    thousandsSeparatorFrom=","
    thousandsSeparatorTo=","
    useNegativeSign="true|false"
    useThousandsSeparator="true|false"/>  
  </pre>
  
  </div>
<script type="text/javascript" language="javascript">
<!--
setMXMLOnly();
--></script>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="../formatters/NumberBase.html" target="">mx.formatters.NumberBase</a>
<br>
<a href="../formatters/NumberBaseRoundType.html" target="">mx.formatters.NumberBaseRoundType</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<div class="showHideLinks">
<div class="hideInheritedProperty" id="hideInheritedProperty">
<a onclick="javascript:setInheritedVisible(false,'Property');" href="#propertySummary" class="showHideLink"><img src="../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Properties</a>
</div>
<div class="showInheritedProperty" id="showInheritedProperty">
<a onclick="javascript:setInheritedVisible(true,'Property');" href="#propertySummary" class="showHideLink"><img src="../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Properties</a>
</div>
</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#decimalSeparatorFrom">decimalSeparatorFrom</a> : String<div class="summaryTableDescription">
      Decimal separator character to use
   when parsing an input String.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#decimalSeparatorTo">decimalSeparatorTo</a> : String<div class="summaryTableDescription">
      Decimal separator character to use
   when outputting formatted decimal numbers.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="Formatter.html#defaultInvalidFormatError">defaultInvalidFormatError</a> : String<div class="summaryTableDescription">[static]
   Error message for an invalid format string specified to the formatter.</div>
</td><td class="summaryTableOwnerCol"><a href="Formatter.html">Formatter</a></td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="Formatter.html#defaultInvalidValueError">defaultInvalidValueError</a> : String<div class="summaryTableDescription">[static]
   Error messages for an invalid value specified to the formatter.</div>
</td><td class="summaryTableOwnerCol"><a href="Formatter.html">Formatter</a></td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="Formatter.html#error">error</a> : String<div class="summaryTableDescription">
   Description saved by the formatter when an error occurs.</div>
</td><td class="summaryTableOwnerCol"><a href="Formatter.html">Formatter</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#precision">precision</a> : Object<div class="summaryTableDescription">
      Number of decimal places to include in the output String.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#rounding">rounding</a> : String<div class="summaryTableDescription">
      Specifies how to round the number.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#thousandsSeparatorFrom">thousandsSeparatorFrom</a> : String<div class="summaryTableDescription">
      Character to use as the thousands separator
   in the input String.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#thousandsSeparatorTo">thousandsSeparatorTo</a> : String<div class="summaryTableDescription">
      Character to use as the thousands separator
   in the output String.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#useNegativeSign">useNegativeSign</a> : Object<div class="summaryTableDescription">
      If <code>true</code>, format a negative number 
   by preceding it with a minus "-" sign.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#useThousandsSeparator">useThousandsSeparator</a> : Object<div class="summaryTableDescription">
      If <code>true</code>, split the number into thousands increments
   by using a separator character.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#NumberFormatter()">NumberFormatter</a>()</div>
<div class="summaryTableDescription">
   Constructor.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#format()">format</a>(value:Object):String</div>
<div class="summaryTableDescription">
      Formats the number as a String.</div>
</td><td class="summaryTableOwnerCol">NumberFormatter</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<div class="showHideLinks">
<div class="hideInheritedProtectedMethod" id="hideInheritedProtectedMethod">
<a onclick="javascript:setInheritedVisible(false,'ProtectedMethod');" href="#protectedMethodSummary" class="showHideLink"><img src="../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Protected Methods</a>
</div>
<div class="showInheritedProtectedMethod" id="showInheritedProtectedMethod">
<a onclick="javascript:setInheritedVisible(true,'ProtectedMethod');" href="#protectedMethodSummary" class="showHideLink"><img src="../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Protected Methods</a>
</div>
</div>
<table id="summaryTableProtectedMethod" class="summaryTable hideInheritedProtectedMethod" cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="hideInheritedProtectedMethod">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="Formatter.html#resourcesChanged()">resourcesChanged</a>():void</div>
<div class="summaryTableDescription">
   This method is called when a Formatter is constructed,
   and again whenever the ResourceManager dispatches
   a <code>"change"</code> Event to indicate
   that the localized resources have changed in some way.</div>
</td><td class="summaryTableOwnerCol"><a href="Formatter.html">Formatter</a></td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="decimalSeparatorFrom"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">decimalSeparatorFrom</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>decimalSeparatorFrom:String</code>&nbsp;&nbsp;[read-write]<p>
      Decimal separator character to use
   when parsing an input String.
     </p><p>The default value is <code>"."</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get decimalSeparatorFrom():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set decimalSeparatorFrom(value:String):void</code>
<br>
</div>
<a name="decimalSeparatorTo"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">decimalSeparatorTo</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>decimalSeparatorTo:String</code>&nbsp;&nbsp;[read-write]<p>
      Decimal separator character to use
   when outputting formatted decimal numbers.
     </p><p>The default value is <code>"."</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get decimalSeparatorTo():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set decimalSeparatorTo(value:String):void</code>
<br>
</div>
<a name="precision"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">precision</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>precision:Object</code>&nbsp;&nbsp;[read-write]<p>
      Number of decimal places to include in the output String.
   You can disable precision by setting it to <code>-1</code>.
   A value of <code>-1</code> means do not change the precision. For example, 
   if the input value is 1.453 and <code>rounding</code> 
   is set to <code>NumberBaseRoundType.NONE</code>, return a value of 1.453.
   If <code>precision</code> is <code>-1</code> and you have set some form of 
   rounding, return a value based on that rounding type.
     </p><p>The default value is <code>-1</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get precision():Object</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set precision(value:Object):void</code>
<br>
</div>
<a name="rounding"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">rounding</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>rounding:String</code>&nbsp;&nbsp;[read-write]<p>
      Specifies how to round the number.
        </p><p>In ActionScript, you can use the following constants to set this property: 
   <code>NumberBaseRoundType.NONE</code>, <code>NumberBaseRoundType.UP</code>,
   <code>NumberBaseRoundType.DOWN</code>, or <code>NumberBaseRoundType.NEAREST</code>.
      Valid MXML values are "down", "nearest", "up", and "none".</p>
     <p>The default value is <code>NumberBaseRoundType.NONE</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get rounding():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set rounding(value:String):void</code>
<br>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../formatters/NumberBaseRoundType.html" target="">mx.formatters.NumberBaseRoundType</a>
</div>
</div>
<a name="thousandsSeparatorFrom"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">thousandsSeparatorFrom</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>thousandsSeparatorFrom:String</code>&nbsp;&nbsp;[read-write]<p>
      Character to use as the thousands separator
   in the input String.
     </p><p>The default value is <code>","</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get thousandsSeparatorFrom():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set thousandsSeparatorFrom(value:String):void</code>
<br>
</div>
<a name="thousandsSeparatorTo"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">thousandsSeparatorTo</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>thousandsSeparatorTo:String</code>&nbsp;&nbsp;[read-write]<p>
      Character to use as the thousands separator
   in the output String.
     </p><p>The default value is <code>","</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get thousandsSeparatorTo():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set thousandsSeparatorTo(value:String):void</code>
<br>
</div>
<a name="useNegativeSign"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">useNegativeSign</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>useNegativeSign:Object</code>&nbsp;&nbsp;[read-write]<p>
      If <code>true</code>, format a negative number 
   by preceding it with a minus "-" sign.
   If <code>false</code>, format the number
   surrounded by parentheses, for example (400).
     </p><p>The default value is <code>true</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get useNegativeSign():Object</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set useNegativeSign(value:Object):void</code>
<br>
</div>
<a name="useThousandsSeparator"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">useThousandsSeparator</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>useThousandsSeparator:Object</code>&nbsp;&nbsp;[read-write]<p>
      If <code>true</code>, split the number into thousands increments
   by using a separator character.
     </p><p>The default value is <code>true</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get useThousandsSeparator():Object</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set useThousandsSeparator(value:Object):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="NumberFormatter()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">NumberFormatter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function NumberFormatter()</code><p>
   Constructor.
  </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="format()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">format</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public override function format(value:Object):String</code><p>
      Formats the number as a String.
   If <code>value</code> cannot be formatted, return an empty String 
   and write a description of the error to the <code>error</code> property.
        </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">value</span>:Object</code> &mdash; Value to format.
        </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; Formatted String. Empty if an error occurs.
     </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
